// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  cmpa_c_union_define.h
// Project line  :  K3
// Department    :  K3
// Author        :  Huawei
// Version       :  V100
// Date          :  2015/4/10
// Description   :  HiVcodecV100 VDEC
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 10:02:39 Create file
// ******************************************************************************

#ifndef __CMPA_C_UNION_DEFINE_H__
#define __CMPA_C_UNION_DEFINE_H__

/* Define the union U_CMPA_YSTADDR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    ystaddr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_YSTADDR;

/* Define the union U_CMPA_UVOFFSET */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    uvoffset : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_UVOFFSET;

/* Define the union U_CMPA_YSTRIDE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0   : 12  ; /* [31:20] */
        unsigned int    ystride : 20  ; /* [19:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_YSTRIDE;

/* Define the union U_CMPA_LINE_NUM_STADDR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    line_num_staddr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_LINE_NUM_STADDR;

/* Define the union U_CMPA_LINE_LEVEL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    cmp_line_level : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_LINE_LEVEL;

/* Define the union U_CMPA_PIC_INFO_OTHERS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_1                     : 2  ; /* [31:30] */
        unsigned int    ctb_size                  : 3  ; /* [29:27] */
        unsigned int    protocol                  : 4  ; /* [26:23] */
        unsigned int    frm_cmp_en                : 1  ; /* [22] */
        unsigned int    pic_height_other_protocol : 11  ; /* [21:11] */
        unsigned int    pic_width_other_protocol  : 11  ; /* [10:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_PIC_INFO_OTHERS;

/* Define the union U_CMPA_PIC_INFO_H265 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_2                    : 1  ; /* [31] */
        unsigned int    pic_height_h265_protocol : 15  ; /* [30:16] */
        unsigned int    rsv_3                    : 1  ; /* [15] */
        unsigned int    pic_width_h265_protocol  : 15  ; /* [14:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_PIC_INFO_H265;

/* Define the union U_CMPA_PIC_PIX_INFO */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_4                : 1  ; /* [31] */
        unsigned int    pic_height_in_sample : 15  ; /* [30:16] */
        unsigned int    rsv_5                : 1  ; /* [15] */
        unsigned int    pic_width_in_sample  : 15  ; /* [14:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_PIC_PIX_INFO;

/* Define the union U_CMPA_BITDEPTH */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6           : 21  ; /* [31:11] */
        unsigned int    pic_structure   : 2  ; /* [10:9] */
        unsigned int    cmp_linear_mode : 1  ; /* [8] */
        unsigned int    y_bitdepth      : 4  ; /* [7:4] */
        unsigned int    c_bitdepth      : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_BITDEPTH;

/* Define the union U_CMPA_HEAD_INF_SIZE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    head_inf_size : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_HEAD_INF_SIZE;

/* Define the union U_CMPA_DEBUF_INFO */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    o_ice_share_ext : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_DEBUF_INFO;

/* Define the union U_CMPA_HEAD_STRIDE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_7       : 12  ; /* [31:20] */
        unsigned int    head_stride : 20  ; /* [19:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_HEAD_STRIDE;

/* Define the union U_CMPA_FORMAT_CFG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_8           : 26  ; /* [31:6] */
        unsigned int    semi_planar_en  : 1  ; /* [5] */
        unsigned int    bit10_2bit_dis  : 1  ; /* [4] */
        unsigned int    bit10_expand_16 : 1  ; /* [3] */
        unsigned int    frm_cmp_en      : 1  ; /* [2] */
        unsigned int    cmp_linear_mode : 1  ; /* [1] */
        unsigned int    afbc_work_en    : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CMPA_FORMAT_CFG;

/* Define the union U_CUR_ST */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_9        : 5  ; /* [31:27] */
        unsigned int    cur_st_wtbuf : 3  ; /* [26:24] */
        unsigned int    rsv_10       : 5  ; /* [23:19] */
        unsigned int    cur_st_obuf  : 3  ; /* [18:16] */
        unsigned int    rsv_11       : 5  ; /* [15:11] */
        unsigned int    cur_st_ribuf : 3  ; /* [10:8] */
        unsigned int    rsv_12       : 6  ; /* [7:2] */
        unsigned int    cur_st_wibuf : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CUR_ST;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_CMPA_YSTADDR         CMPA_YSTADDR         ; /* 0 */
    volatile U_CMPA_UVOFFSET        CMPA_UVOFFSET        ; /* 4 */
    volatile U_CMPA_YSTRIDE         CMPA_YSTRIDE         ; /* 8 */
    volatile U_CMPA_LINE_NUM_STADDR CMPA_LINE_NUM_STADDR ; /* C */
    volatile U_CMPA_LINE_LEVEL      CMPA_LINE_LEVEL      ; /* 10 */
    volatile U_CMPA_PIC_INFO_OTHERS CMPA_PIC_INFO_OTHERS ; /* 14 */
    volatile U_CMPA_PIC_INFO_H265   CMPA_PIC_INFO_H265   ; /* 18 */
    volatile U_CMPA_PIC_PIX_INFO    CMPA_PIC_PIX_INFO    ; /* 1C */
    volatile U_CMPA_BITDEPTH        CMPA_BITDEPTH        ; /* 20 */
    volatile U_CMPA_HEAD_INF_SIZE   CMPA_HEAD_INF_SIZE   ; /* 24 */
    volatile U_CMPA_DEBUF_INFO      CMPA_DEBUF_INFO      ; /* 28 */
    volatile U_CMPA_HEAD_STRIDE     CMPA_HEAD_STRIDE     ; /* 2C */
    volatile U_CMPA_FORMAT_CFG      CMPA_FORMAT_CFG      ; /* 30 */
    volatile U_CUR_ST               CUR_ST               ; /* 34 */

} S_cmpa_REGS_TYPE;

/* Declare the struct pointor of the module cmpa */
extern volatile S_cmpa_REGS_TYPE *gopcmpaAllReg;

/* Declare the functions that set the member value */
int iSetCMPA_YSTADDR_ystaddr(unsigned int uystaddr);
int iSetCMPA_UVOFFSET_uvoffset(unsigned int uuvoffset);
int iSetCMPA_YSTRIDE_ystride(unsigned int uystride);
int iSetCMPA_LINE_NUM_STADDR_line_num_staddr(unsigned int uline_num_staddr);
int iSetCMPA_LINE_LEVEL_cmp_line_level(unsigned int ucmp_line_level);
int iSetCMPA_PIC_INFO_OTHERS_ctb_size(unsigned int uctb_size);
int iSetCMPA_PIC_INFO_OTHERS_protocol(unsigned int uprotocol);
int iSetCMPA_PIC_INFO_OTHERS_frm_cmp_en(unsigned int ufrm_cmp_en);
int iSetCMPA_PIC_INFO_OTHERS_pic_height_other_protocol(unsigned int upic_height_other_protocol);
int iSetCMPA_PIC_INFO_OTHERS_pic_width_other_protocol(unsigned int upic_width_other_protocol);
int iSetCMPA_PIC_INFO_H265_pic_height_h265_protocol(unsigned int upic_height_h265_protocol);
int iSetCMPA_PIC_INFO_H265_pic_width_h265_protocol(unsigned int upic_width_h265_protocol);
int iSetCMPA_PIC_PIX_INFO_pic_height_in_sample(unsigned int upic_height_in_sample);
int iSetCMPA_PIC_PIX_INFO_pic_width_in_sample(unsigned int upic_width_in_sample);
int iSetCMPA_BITDEPTH_pic_structure(unsigned int upic_structure);
int iSetCMPA_BITDEPTH_cmp_linear_mode(unsigned int ucmp_linear_mode);
int iSetCMPA_BITDEPTH_y_bitdepth(unsigned int uy_bitdepth);
int iSetCMPA_BITDEPTH_c_bitdepth(unsigned int uc_bitdepth);
int iSetCMPA_HEAD_INF_SIZE_head_inf_size(unsigned int uhead_inf_size);
int iSetCMPA_DEBUF_INFO_o_ice_share_ext(unsigned int uo_ice_share_ext);
int iSetCMPA_HEAD_STRIDE_head_stride(unsigned int uhead_stride);
int iSetCMPA_FORMAT_CFG_semi_planar_en(unsigned int usemi_planar_en);
int iSetCMPA_FORMAT_CFG_bit10_2bit_dis(unsigned int ubit10_2bit_dis);
int iSetCMPA_FORMAT_CFG_bit10_expand_16(unsigned int ubit10_expand_16);
int iSetCMPA_FORMAT_CFG_frm_cmp_en(unsigned int ufrm_cmp_en);
int iSetCMPA_FORMAT_CFG_cmp_linear_mode(unsigned int ucmp_linear_mode);
int iSetCMPA_FORMAT_CFG_afbc_work_en(unsigned int uafbc_work_en);
int iSetCUR_ST_cur_st_wtbuf(unsigned int ucur_st_wtbuf);
int iSetCUR_ST_cur_st_obuf(unsigned int ucur_st_obuf);
int iSetCUR_ST_cur_st_ribuf(unsigned int ucur_st_ribuf);
int iSetCUR_ST_cur_st_wibuf(unsigned int ucur_st_wibuf);

#endif // __CMPA_C_UNION_DEFINE_H__
